package com.zang.websocket.listener;

import com.zang.api.service.EmployService;
import com.zang.model.entity.Employ;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author Zhang Qiang
 * @date 2019/10/23 14:31
 */
@Slf4j
@Component
public class EmployListener implements ToListener<Object, Employ>{

    @Resource
    EmployService employService;

    @Override
    public Employ listener(String eName, Object date) {
        if (date!=null){
            log.info( "date :" + date.toString());
        }
        return employService.get(eName);
    }

}
